package ui;
import java.awt.BorderLayout;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
import javax.swing.SwingUtilities;



/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class StaffHome extends javax.swing.JFrame {

	
	
	private LoginPresentation loginPr;
	private String staffID;
	private String staffName;
	private JPanel staffChooseWorkPanel,staffGiftPanel,staffReturnPanel,staffSalePanel,staffRegistVIPPanel;
	private JPanel usingPanel;
	
	public StaffHome(LoginPresentation loginPr,String staffID, String staffName) {
		super();
		initGUI();
		
		this.loginPr = loginPr;
		this.staffID = staffID;	
		this.staffName = staffName;
		
		
		this.staffChooseWorkPanel=new StaffChooseWorkPanel(this);
		this.staffRegistVIPPanel=new StaffRegistVIPPanel(this);
		this.staffSalePanel=new StaffSalePanel(this);
		this.staffReturnPanel=new StaffReturnPanel(this);
		this.staffGiftPanel=new StaffGiftPanel(this);
		
		
		initGUI();
		
		
		this.getContentPane().add(this.staffChooseWorkPanel);
		this.usingPanel=staffChooseWorkPanel;
		setLocationRelativeTo(null);
		setVisible(true);
		
	}
		
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("\u8d85\u5e02\u9500\u552e\u7cfb\u7edf");
			this.setName("StaffJFrame");
			this.setResizable(false);
			getContentPane().setBackground(new java.awt.Color(255,255,255));
			pack();
			this.setSize(640, 480);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	
	
	public String getStaffID(){
		return this.staffID;
	}
	
	
	public String getStaffName(){
		return this.staffName;
	}
	
	
	public void exit(){
		this.dispose();
	}
	

	public void showChooseWorkPanel(){
		this.getContentPane().remove(this.usingPanel);
		this.getContentPane().add(this.staffChooseWorkPanel);
		this.repaint();
		this.usingPanel=this.staffChooseWorkPanel;
	}
	
	
	public void showStaffGiftPanel(){
		this.getContentPane().remove(this.usingPanel);
		this.getContentPane().add(this.staffGiftPanel);
		this.repaint();
		this.usingPanel=this.staffGiftPanel;
	}
	
	
	public void showStaffReturnPanel(){
		this.getContentPane().remove(this.usingPanel);
		this.getContentPane().add(this.staffReturnPanel);
		this.repaint();
		this.usingPanel=this.staffReturnPanel;
	}
	
	
	public void showStaffSalePanel(){
		this.getContentPane().remove(this.usingPanel);
		this.getContentPane().add(this.staffSalePanel);
		this.repaint();
		this.usingPanel=this.staffSalePanel;
	}
	
	
	public void showStaffRegistVIPPanel(){
		this.getContentPane().remove(this.usingPanel);
		this.getContentPane().add(this.staffRegistVIPPanel);
		this.repaint();
		this.usingPanel=this.staffRegistVIPPanel;
	}
	
	public void showHelpPanel(JPanel thePanel){
		this.getContentPane().remove(this.usingPanel);
		this.getContentPane().add(thePanel);
		this.repaint();
		this.usingPanel=thePanel;
	}
	
	public void forcusOnPanel(JPanel thePanel){
		thePanel.requestFocus();
	}
}
